﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Obligatorio2013.Clases
{
    public class Advertisement : IComparable
    {

        #region properties

        public enum type { Basic, Premium }

        public long id { get; set; }
        public type adType { get; set; }
        public string title { get; set; }
        public string description { get; set; }
        public double price { get; set; }
        public DateTime dateFrom { get; set; }
        public DateTime dateTo { get; set; }
        public string phoneContact { get; set; }
        public string mailContact { get; set; }
        public string image { get; set; }
        public bool suspended { get; set; }
        public DateTime dateSuspendedFrom { get; set; }
        public DateTime dateSuspendedTo { get; set; }
        public Users publisher { get; set; }
        #endregion


        #region constructors

        public Advertisement() { }



        #endregion




        public int CompareTo(object obj)
        {
            Advertisement ad = obj as Advertisement;
            // Asi los retorno ordenados desc.
            return this.dateFrom.CompareTo(ad.dateFrom) * -1;
        }
    }
}